/*
 * Copyright (C) 2010 Seapeak.Xu
 *
 * 5173mq may be copied only under the terms of the GNU General
 * Public License V3, which may be found in the 5173mq source kit.
 *
 * Created on: 2010-8-27
 * Author: Seapeak.Xu
 */

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <stddef.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>

#include "fostmq_client.h"

int main(int  argc,char **argv)
{

	char *ip = "127.0.0.1";
	int port = 9090;
	int timeout = 30;
	int i = 0;
	char *id = "test";
	char temp_id[15];
	char *requ_value = "testtest";
	for(i = 0 ; i < 1000000 ; i++)
	{
		//memset(temp_id,'\0',15);
		//sprintf(temp_id,"%s%d",id,i);
		char requ_value_temp[20];
		memset(requ_value_temp,0,20);
		sprintf(requ_value_temp,"%s%d",requ_value,i);
		//push_by_id(ip,port,timeout,temp_id,requ_value_temp);
		//push_by_name(ip,port,timeout,id,requ_value_temp);
		
		char resp_value[20];
		memset(resp_value,'\0',20);
		//pop_by_id(ip,port,timeout,temp_id,resp_value);	
		//printf("index:%d,value:%s\n",i,resp_value);
		pop_by_name(ip,port,timeout,id,resp_value);
		printf("index:%d,value:%s\n",i,resp_value);
	}
		return 0;

}

